require_relative '../backup-volume'

describe "Backup Volume" do

  before(:each) do
    @lines =
       ["Microsoft DiskPart version 5.2.3790.3959",
        "Copyright (C) 1999-2001 Microsoft Corporation.",
        "On computer: IP-0A606278",
        "",
        "Disk 1 is now the selected disk.",
        "",
        "RHEL DISK SCSI Disk Device",
        "Disk ID: 8C4056A6",
        "Type   : FIBRE",
        "Bus    : 1",
        "Target : 0",
        "LUN ID : 1",
        "",
        "  Volume ###  Ltr  Label        Fs     Type        Size     Status     Info",
        "  ----------  ---  -----------  -----  ----------  -------  ---------  --------",
        "  Volume 1     D                NTFS   Partition     30 GB  Healthy"]
    @backupVolume = BackupVolume.new
    @backupVolume.lines = @lines
  end

  it "should extract volume number from disk details" do
    @backupVolume.volume_number.should == "1"
  end

  it "should extract volume drive letter from disk details" do
    @backupVolume.volume_drive.should == "D"
  end

  it "should create script using volume number and letter" do
    @backupVolume.script.should == "select volume=1 \nassign letter=D"
  end

end